import { Node, tween, v3 } from 'cc';
import { HintTinyLoading, ccchild, ccclass, ccmodifier } from '../../../extensions/cc-feather/assets/src';

/**
 * - 作者: DoooReyn
 * - 日期: 2023.11.02
 * - 名称: TinyLoadingCommon
 * - 描述: 通用小加载提示
 */
@ccclass()
@ccmodifier('TinyLoadingCommon')
export class TinyLoadingCommon extends HintTinyLoading {
    @ccchild('Icon')
    icon: Node;

    onLoad() {
        tween(this.icon)
            .to(1, { scale: v3(1.4, 1.2, 1) }, { easing: 'backInOut' })
            .delay(0.2)
            .to(1, { scale: v3(1, 1, 1) }, { easing: 'backInOut' })
            .union()
            .repeatForever()
            .start();
    }
}
